function _taskDel(tid, obj) {
    if (confirm('确定删除该记录?') == 0)return false;
    $(obj).parent().html("处理中");
    var taskDelText = "<a href=\"javascript:\"  onclick=\"_taskDel('" + tid + "',this);\">删除</a>&ensp;";
    $.getJSON("/advertisement/del/index.aspx?r=" + Math.random(), {'adId':tid}, function showData(data) {
        if (data.result == "success") {
            alert("记录已删除");
            var row = $("#" + tid).parent().parent().hide();
            //location.reload();//刷新
        } else {
            $("#_tid1" + tid).html(taskDelText);
            alert("记录删除失败，请重试！");
        }
    });
}
function blockWin(url, title, authId, type) {
    $("#authId").val(authId);
    $("#type").val(type);
    $.funkyUI({
        title:title,
        url:url,
        css:{width:"600",height:"400"}
    });
}
function closeFunc() {
    var id = $("#authId").val();
    var type = $("#type").val();
    if (type == 1) {
        $.getJSON("/advertisement/audit/set/index.aspx?r=" + Math.random(), {adId:id,'param':'q'}, function(data) {
            if (data.result == "success") {
                var audit = data.audit;
                $("#" + id).parent().parent().find("td:eq(5)").html(audit);
            }
        });
    }
    if (type == 2) {
        $.getJSON("/advertisement/audit/set/index.aspx?r=" + Math.random(), {adId:id,'param':'q3'}, function(data) {

            if (data.result == "success") {
                var displayEnabled = data.displayEnabled;
                var budgetEnabled = data.budgetEnabled;
                var rateEnabled = data.rateEnabled;
                var dataStatus = data.dataStatus;
                if (dataStatus == '删除') {
                    row.hide()
                }
                var row = $("#" + id).parent().parent();
                row.find("td:eq(7)").html(displayEnabled);
                row.find("td:eq(8)").html(budgetEnabled);
                row.find("td:eq(6)").html(rateEnabled);
                row.find("td:eq(4)").html(dataStatus);
            }
        });
    }
    if (type == 0) {
        location.reload();
    }
}